%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for mutations/v4/nested_arrays.updateT"
    Bucket0("Bucket 0 (root)"):::bucket
    Bucket1("Bucket 1 (mutationField)<br />Deps: 13, 8, 14, 2<br /><br />1: PgUpdateSingle[10]<br />2: <br />ᐳ: Object[15]"):::bucket
    Bucket2("Bucket 2 (nullableBoundary)<br />Deps: 2, 10, 15<br /><br />ROOT Object{1}ᐸ{result}ᐳ[15]"):::bucket
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 10, 25, 26<br /><br />ROOT PgUpdateSingle{1}ᐸt(k;)ᐳ[10]"):::bucket
    Bucket5("Bucket 5 (listItem)<br />Deps: 25, 26, 10<br /><br />ROOT __Item{5}ᐸ18ᐳ[21]<br />1: PgSelect[22]<br />2: PgSelectRows[27]"):::bucket
    Bucket6("Bucket 6 (listItem)<br />Deps: 10<br /><br />ROOT __Item{6}ᐸ27ᐳ[28]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket2
    Bucket2 --> Bucket3
    Bucket3 --> Bucket5
    Bucket5 --> Bucket6

    %% plan dependencies
    Object13{{"Object[13∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access11{{"Access[11∈0] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access11 & Access12 --> Object13
    Access6{{"Access[6∈0] ➊<br />ᐸ0.inputᐳ"}}:::plan
    __Value0["__Value[0∈0] ➊<br />ᐸvariableValuesᐳ"]:::plan
    __Value0 --> Access6
    Access8{{"Access[8∈0] ➊<br />ᐸ0.input.kᐳ"}}:::plan
    __Value0 --> Access8
    ApplyInput14{{"ApplyInput[14∈0] ➊"}}:::plan
    Access6 --> ApplyInput14
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ<br />Dependents: 4"]:::plan
    PgUpdateSingle10[["PgUpdateSingle[10∈1] ➊<br />ᐸt(k;)ᐳ"]]:::sideeffectplan
    Object13 & Access8 & ApplyInput14 --> PgUpdateSingle10
    Object15{{"Object[15∈1] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgUpdateSingle10 --> Object15
    Object25{{"Object[25∈2] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access23{{"Access[23∈2] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access24{{"Access[24∈2] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access23 & Access24 --> Object25
    PgFromExpression26{{"PgFromExpression[26∈2] ➊"}}:::plan
    PgClassExpression16{{"PgClassExpression[16∈3] ➊<br />ᐸ__t__.”k”ᐳ"}}:::plan
    Access17{{"Access[17∈3] ➊<br />ᐸ10.tᐳ"}}:::plan
    Access17 --> PgClassExpression16
    PgUpdateSingle10 --> Access17
    PgClassExpression18{{"PgClassExpression[18∈3] ➊<br />ᐸ__t__.”v”ᐳ"}}:::plan
    Access17 --> PgClassExpression18
    PgSelect22[["PgSelect[22∈5]<br />ᐸfrmcdc_workHourᐳ"]]:::plan
    __Item21[/"__Item[21∈5]<br />ᐸ18ᐳ"\]:::itemplan
    Object25 & __Item21 & PgFromExpression26 --> PgSelect22
    PgClassExpression18 ==> __Item21
    PgSelectRows27[["PgSelectRows[27∈5]"]]:::plan
    PgSelect22 --> PgSelectRows27
    __Item28[/"__Item[28∈6]<br />ᐸ27ᐳ"\]:::itemplan
    PgSelectRows27 ==> __Item28
    PgSelectSingle29{{"PgSelectSingle[29∈6]<br />ᐸfrmcdc_workHourᐳ"}}:::plan
    __Item28 --> PgSelectSingle29
    PgClassExpression30{{"PgClassExpression[30∈6]<br />ᐸ__frmcdc_w...rom_hours”ᐳ"}}:::plan
    PgSelectSingle29 --> PgClassExpression30
    PgClassExpression31{{"PgClassExpression[31∈6]<br />ᐸ__frmcdc_w...m_minutes”ᐳ"}}:::plan
    PgClassExpression30 o--o PgClassExpression31
    PgClassExpression32{{"PgClassExpression[32∈6]<br />ᐸ__frmcdc_w...”to_hours”ᐳ"}}:::plan
    PgClassExpression31 o--o PgClassExpression32
    PgClassExpression33{{"PgClassExpression[33∈6]<br />ᐸ__frmcdc_w...o_minutes”ᐳ"}}:::plan
    PgClassExpression32 o--o PgClassExpression33

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value0,__Value2,Access6,Access8,Access11,Access12,Object13,ApplyInput14 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgUpdateSingle10,Object15 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,Access23,Access24,Object25,PgFromExpression26 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3,PgClassExpression16,Access17,PgClassExpression18 bucket3
    classDef bucket5 stroke:#7fff00
    class Bucket5,__Item21,PgSelect22,PgSelectRows27 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,__Item28,PgSelectSingle29,PgClassExpression30,PgClassExpression31,PgClassExpression32,PgClassExpression33 bucket6

    %% implicit side effects
    PgUpdateSingle10 -.-o Access23
    PgUpdateSingle10 -.-o Access24
    PgUpdateSingle10 -.-o PgFromExpression26

